home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-03-19 | 5.9 KB | 146 lines | [TEXT/KAHL] |
- Application: Print Job Query
-
- History:
- Feb. 12th, 1993 V1.00 Created and tested.
- Feb. 19th, 1993 V1.01 Added code to display error messages,
- include host name, printer name,
- and time of query.
- March 2th, 1993 V1.02 Fix bug with receive data code.
- March 6th, 1993 V1.03 Fix bug which cause it to crash if openconnect failed (-23015).
- March 19th,1993 V1.1 - Added Host menu option (Str# 129)
- - Added Finder Information for Balloon help
- - caching of IP Address between queires.
- - Background update every 5 mins of current status (zero = diabled).
- (STR# 128, index 15).
-
- Display one or more unix lpr queues on a Macintosh by running a unix
- script to get the status of the selected printers.
-
- This program is free, it can not be sold or bundled with any
- commercial program (except NetDoctor), but it may be distributed with CAP.
-
- Send suggestions, bug reports to:
-
- By: R. Mark Fleming
- Phone: (613) 545-2039 Fax: (613) 544-7499
- InterNet: markf@POST.QueensU.CA
-
- ** The Author of NetDoctor, a Lab and Network Maintainer Package **
-
- *************** Macintosh Program Requirements *************************
-
- Requires:
- * MacTCP installed.
- * 200K of free memory (may run with less, have not tried).
- * System 6 or 7.
-
- Errors: During status query, two possible error message are returned.
-
- 1) Domain Name Server not responding.
- Error # -xx.
- 2) Server not responding or could not connect.
- Error # -xx.
-
- The Macintosh error code -xx will be most likely be a MacTCP error
- code in the range -230xx.
- eg.
- -23015 the connection came halfway up and then failed
- (Check Unix TCP Permisions/Security setttings of destination host).
-
- NOTE: Does not support System 7's AppleEvents.
-
- ***** The Details on Unix Side ***************************************
-
- From: mike@ccs-master.queensu.ca (Mike Smith)
- To: MARKF@POST.QUEENSU.CA (Mark Fleming)
- Subject: Laser Printer Queries
- Date: Wednesday, 17 February 1993
-
- The nature of the Unix print subsystem means that our LaserJet IIIsi
- is 12 logical printers. That is, there are 12 printcap entries and 12
- spool directories that point to the one physical printer. Each logical printer
- identifies the form to be printed and whether the job is single- or double-sided
- This potentially bewildering situation is made manageable by a simple naming
- convention: each logical printer name is the concatenation of a physical printer
- name, a form name, and the letter D if the output is double-sided. For the IIIs
- this gives names like ccsaletter, ccsaletterD, ccsa3hole, ccsa3holeD, and so on.
-
- Normally, two logical printers are active at once, e.g. ccsaletter and ccsale
- We use the second paper bin on the IIIsi for coloured separator sheets. If
- the second bin were loaded with 3hole then 4 logical printers would normally
- be active. (By active I mean that the queues will empty as the physical printer
- becomes available. The other logical printers will queue jobs but not print unt
- the operator loads the form.)
-
- This separation into multiple logical printers is generally unimportant to
- the user. In particular, when (s)he queries the IIIsi queue, it is expected
- that all jobs queued for the 12 logical printers will be listed.
-
- On the VM (or Mac) side, a socket is opened on port 15000. This number
- was arbitrarily assigned by the Systems group. Port 15000 is defined in
- /etc/services as
-
- rqlaser 15000/tcp # Remote laser printer query
-
- and in /etc/inetd.conf as
-
- rqlaser stream tcp nowait opprt1 /home/ccs-master/opprt1/rqlaser rqlaser
-
- The second last column is the path to a shell script that runs lpq once on
- each printer and nawks the lpq output to produce a table that includes the
- form name for each job. The nawk script also greps files that originated on the
- Mac for %%For and %%Title comments. The values of these comments replace the
- lwsrv process owner (root) and lwsrv spool file name. This makes the output
- of rqlaser considerably more informative than the unmodified lpq data.
-
- Hope this helps,
-
- Mike Smith mike@ccs.queensu.ca
- Queen's University Michael.D.Smith@QueensU.CA
- Computing and Communications Services (613) 545-2024
-
- ************** Sample Unix Script that uses lpq ************************
-
- #!/bin/sh
- # rqlaser is called by the inetd daemon to service remote queries for
- # laser printer queues. The printer name is read from the standard
- # input. At Queen's we run a more elaborate script to support special
- # forms. This example simply calls the standard lpq command.
- read Printer
- /usr/ucb/lpq -P$Printer
-
-
- *************** Macintosh Program Configuring ***********************
-
- Configuring Query program with ResEdit:
-
- Use ResEdit to congiure STR# resource 128 as follows:
-
- 1) Unix host name to connect to
- (Domain Name Server is used to lookup IP Address).
- 2) Printer name passed as command to unix host once the
- connection is opened.
- 10, 11, 12 are messages, if they are not empty the following information will be displayed:
- host name, printer name, and update time in status window.
- 14) TCP/IP port to connect to:
- Must match what you defined in /etc/services on the unix side.
- 15) Number of minutes between doing a query update, set to zero to disable.
-
- All other strings are messages in this resource are displayed during query.
-
-
- **************** Host Menu Configuration *****************************
-
- STR# 129 contains the list of host and other related information.
-
- Each menu entry consists of 4 entries in this string, they are as follows:
- - Description displayed in the menu
- (You can assign Command Key to options to items eg. /P - for Command-P),
- See: Inside Mac or Think Reference and lookup InsMenuItem() routine).
- - host address to query
- - command to send to the host
- - port number to query
-
- If this STR# resource is not present, no "Host" menu will be created and the
- information stored in STR# 128 will be used.
-